<template>
  <section>
    <div>
      <span>品牌大全</span>
      <button @click="checkIn">品牌入驻</button>
    </div>

    <screen-brand :screen-brand-msg="allBrand" />

    <ul class="brandList">
      <li v-for="(item,index) in brandList" :key="index" @click="goBrandInfo">
        <div class="imgBox">
          <img :src="item.logo">
        </div>
        <div class="listCon">
          <span v-if="item.joinOpen" />
          <button v-else @click.stop="joinIn">我要加盟</button>
          <img v-if="item.rzBool" src="../../../../assets/img/all-brand/yrz.png">
          <img v-else src="../../../../assets/img/all-brand/wrz.png">
        </div>
      </li>
    </ul>
    <div class="ceSelfPages">
      <el-pagination
        :current-page.sync="currentPage"
        :page-size="100"
        background
        layout="prev, pager, next, jumper"
        :total="1000"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </div>
  </section>
</template>

<script>
import screenBrand from '../../../../components/template-item1/screenBrand'
export default {
  components: { screenBrand },
  data() {
    return {
      allBrand: {
        citys: {
          tit: '按品牌所在地：',
          data: ['国际', '北京', '天津', '石家庄', '国际', '美国', '国际', '国际', '国际', '国际', '国际', '国际', '国际', '国际', '国际', '国际', '国际', '国际', '国际', '国际', '国际', '国际', '国际']
        },
        pinyin: {
          tit: '安投资金额：',
          data: ['全部', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '#'],
          style: {
            /* width: 'auto',
            marginRight: '30px' */
          }
        }
      },

      brandList: [
        {
          logo: require('../../../../assets/img/all-brand/logo1.png'),
          rzBool: true,
          joinOpen: true
        },
        {
          logo: require('../../../../assets/img/all-brand/logo2.png'),
          rzBool: true,
          joinOpen: true
        },
        {
          logo: require('../../../../assets/img/all-brand/logo3.png'),
          rzBool: false,
          joinOpen: true
        },
        {
          logo: require('../../../../assets/img/all-brand/logo4.png'),
          rzBool: true,
          joinOpen: true
        },
        {
          logo: require('../../../../assets/img/all-brand/logo5.png'),
          rzBool: false,
          joinOpen: false
        },
        {
          logo: require('../../../../assets/img/all-brand/logo6.png'),
          rzBool: true,
          joinOpen: true
        },
        {
          logo: require('../../../../assets/img/all-brand/logo7.png'),
          rzBool: true,
          joinOpen: false
        },
        {
          logo: require('../../../../assets/img/all-brand/logo7.png'),
          rzBool: true,
          joinOpen: false
        },
        {
          logo: require('../../../../assets/img/all-brand/logo7.png'),
          rzBool: true,
          joinOpen: false
        },
        {
          logo: require('../../../../assets/img/all-brand/logo8.png'),
          rzBool: true,
          joinOpen: true
        }
      ],
      currentPage: 5
    }
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
    },
    goBrandInfo() {
      // this.$router.push('/vMain/allBrand/brand2B')
      this.$router.push('/vMain/allBrand/brand2C')
    },
    checkIn() {
      this.$store.commit('template1/allBrandPopBoolPprz', true)
    },
    joinIn() {
      this.$store.commit('template1/changePopJoin', true)
    }
  }
}
</script>

<style lang="scss" scoped>
section{
    width: 1200px;
    margin: 0 auto;
    >div:first-child{
      width: 100%;
      height: 77px;
      display: flex;
      flex-flow: row nowrap;
      justify-content: space-between;
      align-items: center;
      >span{
        font-size: 20px;
        color: #666;
      }
      >button{
        width: 100px;
        height: 36px;
        line-height: 36px;
        background-color: #417AEF;
        font-size: 14px;
        color: #fff;
        text-align: center;
        cursor: pointer;
      }
    }

    >.brandList{
      width: 100%;
      display: flex;
      flex-flow: row wrap;
      justify-content: flex-start;
      align-items: center;
      >li{
        width: 288px;
        height: 222px;
        margin-bottom: 20px;
        background-color: #fff;
        overflow: hidden;
        margin-right: 16px;
        cursor: pointer;
        >.imgBox{
          width: 100%;
          height: 162px;
          border-bottom: 1px solid #eee;
          overflow: hidden;
          display: flex;
          flex-flow: row nowrap;
          justify-content: center;
          align-items: center;
          >img{
            display: block;
            max-width: 224px;
            max-height: 112px;
          }
        }
        >.listCon{
          width: 100%;
          height: 60px;
          background-color: #fff;
          display: flex;
          flex-flow: row nowrap;
          justify-content: space-between;
          align-items: center;
          padding: 0 25px 0 20px;
          font-size: 16px;
          >span{
            color: #666;
          }
          >button{
            width: 90px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            color: #417AEF;
            border: 1px solid #417AEF;
            background-color: #fff;
            cursor: pointer;
          }
          >img{
            display: block;
            width: 78px;
            height: 20px;
          }
        }
      }
      >li:nth-child(4n){
        margin-right: 0;
      }
    }
    >.ceSelfPages{
      height: 120px;
      line-height: 120px;
      padding-top: 30px;
      padding-bottom: 70px;
      >.el-pagination{
        text-align: center;
        >.el-pager {
          >li{
            font-size: 14px;
          }
          .el-pagination.is-background .el-pager li{
            background-color: #fff;
          }
        }
        >.el-pagination__jump{
          padding-top: 3px;
        }
      }
    }
  }
</style>
